<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='房间管理-新增',jsPaths='/static/js/baseinfo/room/add.js')">
<div class="right" th:fragment="right">
            <!--面包屑-->
            <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                      <a href="/organization">系统管理</a>
                    <a href="/room">房间管理</a>
                    <a><cite>新增</cite></a>
                </span>
            </div>

            <!--主体内容区-->
            <div class="form-content layui-container">
                    <form class="layui-form" th:action="@{/room/save}" method="post">

                        <div class="layui-form-item">
                            <label class="layui-form-label must">所属楼宇</label>
                            <div class="layui-input-block">
                                <select name="buildingId" lay-verify="required" id="buildingId"  lay-filter="buildingId">
                                    <option value=""></option>
                                    <option th:each="b:${buildings}" th:value="${b.id}" th:text="${b.name}"></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label must">所属楼层</label>
                            <div class="layui-input-block">
                                <select id="floorNo" name="floor" lay-filter="floorNo" lay-verify="required">
                                    <option value=""></option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">房间标签</label>
                            <div class="layui-input-block">
                                <input type="text" name="tag"  maxlength="50"  placeholder="请输入标签(自定义的房间类型，如:普通房、四人间)" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label must">房间编号</label>
                            <div class="layui-input-block">
                                <input type="text" name="code"  id="code" maxlength="10" lay-verify="required|selectDistinct" placeholder="请输入房间编号,如：102" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">房间面积</label>
                                    <div class="layui-input-inline">
                                        <input type="number" name="area"   oninput="if (value.length>4){value=value.slice(0,4)}else if (value.length==0){value=0} "  min="0" value="0" placeholder="请输入房间面积" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">m<sup>2</sup></div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">房间朝向</label>
                                    <div class="layui-input-inline">
                                        <select name="direction" lay-verify="required">
                                            <option value="0"></option>
                                            <option value="1">朝南</option>
                                            <option value="2">朝北</option>
                                            <option value="3">朝西</option>
                                            <option value="4">朝东</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label must">是否可用</label>
                            <div class="layui-input-block">
                                <select name="status" lay-verify="required">
                                    <option value="1">是</option>
                                    <option value="3">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                                <a href="/room" class="layui-btn layui-btn-primary">返回</a>
                            </div>
                        </div>
                    </form>

            </div>
        </div>
</html>